home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / hard / drivr / cyberx10.lha / CyberX10 / Source / CyberX10.h < prev    next >
C/C++ Source or Header  |  1992-10-19  |  3KB  |  133 lines

  1. #include <exec/types.h>
  2. #include <exec/nodes.h>
  3.  
  4. #include <exec/execbase.h>
  5. #include <exec/memory.h>
  6. #include <exec/ports.h>
  7. #include <dos/rdargs.h>
  8. #include <dos/dostags.h>
  9. #include <dos/datetime.h>
  10. #include <devices/serial.h>
  11. #include <intuition/intuitionbase.h>
  12. #include <workbench/startup.h>
  13. #include <workbench/workbench.h>
  14.  
  15. #include <clib/exec_protos.h>
  16. extern struct ExecBase *SysBase;
  17. #include <pragmas/exec_libcall_lib.h>
  18.  
  19. #include <clib/dos_protos.h>
  20. extern struct DosLibrary *DOSBase;
  21. #include <pragmas/dos_lib.h>
  22.  
  23. #include <clib/timer_protos.h>
  24. #define TimerBase (TimerIO.tr_node.io_Device)
  25. #include <pragmas/timer_lib.h>
  26.  
  27. #include <clib/icon_protos.h>
  28. extern struct Library *IconBase;
  29. #include <pragmas/icon_lib.h>
  30.  
  31. #include <clib/intuition_protos.h>
  32. #include <pragmas/intuition_lib.h>
  33.  
  34. #include <clib/locale_protos.h>
  35. #define LocaleBase LocaleInfo.li_LocaleBase
  36. #include <pragmas/locale_lib.h>
  37.  
  38. #include <clib/alib_protos.h>
  39.  
  40. #include <stdio.h>
  41. #define USE_BUILTIN_MATH TRUE
  42. #include <string.h>
  43. #include <stdlib.h>
  44. #include <stdarg.h>
  45. #include <ctype.h>
  46. #include <math.h>
  47. #include <dos.h>    /* for __emit() prototype */
  48.  
  49. #define CATCOMP_NUMBERS
  50. #include "CyberX10_Strings.h"
  51.  
  52. #include "OwnDevUnit.h"
  53.  
  54. #define SECSINDAY (86400)
  55. #define SECSINHOUR (3600)
  56. #define SECSINMINUTE (60)
  57.  
  58. #define BIG_BUF_SIZE_BASE (1024)
  59. #define BIG_BUF_SIZE_XTRA (16)
  60. #define BIG_BUF_SIZE (BIG_BUF_SIZE_BASE + BIG_BUF_SIZE_XTRA)
  61.  
  62. /* some magic returns from the serial input routine */
  63. #define TIMEOUT (0xFFFF)
  64. #define EMPTY (0xFFFE)
  65.  
  66. /* a magic assign for the name of the program */
  67. #define PROGNAME GetString(&LocaleInfo, MSG_PROGNAME)
  68.  
  69. /* exports from Timer.c */
  70. extern struct timerequest TimerIO;
  71. extern ULONG TimerSigMask;
  72.  
  73. /* exports from MyPrintf.c */
  74. extern BOOL ErrorsToEzReq;
  75.  
  76. /* exports from CyberX10.c */
  77. extern const UBYTE HouseCode[16];
  78. extern struct LocaleInfo LocaleInfo;
  79. extern struct Locale *DefaultLocale;
  80.  
  81. void __stdargs kprintf(STRPTR fmt, ...);
  82.  
  83. /* prototypes for functions in CyberX10.c */
  84.  
  85. int __regargs main(char *cmdptr, int cmdlen, struct WBStartup *WBMsg);
  86. void DoInstance(STRPTR ArgLine, STRPTR ArgHelp);
  87. void X10TurnOn(STRPTR *Targets);
  88. void X10TurnOff(STRPTR *Targets);
  89. void X10Dim(STRPTR *Targets, ULONG DimLevel);
  90. void OnOffDimHandler(STRPTR *Targets, ULONG DimLevel, ULONG Function, LONG Msg);
  91. void X10SetBaseHC(STRPTR BaseHC);
  92. void X10SetClock(void);
  93. void X10Diagnostic(void);
  94. int  X10GetHC(UBYTE Char);
  95. BOOL X10SendDirectCmd(int HC, int Unit, ULONG Function, ULONG DimLevel);
  96. BOOL X10WaitForAck(BOOL WaitForUploadReport);
  97.  
  98. /* prototypes for functions in X10UpDown.c */
  99.  
  100. void X10Download(STRPTR filename);
  101. void X10Upload(STRPTR filename);
  102.  
  103. /* prototypes for functions in MyPrintf.c */
  104.  
  105. void __stdargs ErrorMsg(LONG, ...);
  106. void __stdargs MyPrintf(LONG, ...);
  107.  
  108. /* prototypes for functions in WBtoCLIargs.c */
  109.  
  110. STRPTR WBtoCLIargs(struct WBArg * WBArg, STRPTR ArgTemplate);
  111.  
  112. /* prototypes for functions in Timer.c */
  113.  
  114. BOOL OpenTimer(void);
  115. void CloseTimer(void);
  116.  
  117. /* prototypes for functions in Serial.c */
  118.  
  119. BOOL OpenSerial(STRPTR Device, ULONG Unit, BOOL AttemptMode);
  120. void CloseSerial(void);
  121. void ClearSerial(void);
  122. void SerWrite(STRPTR Buf, ULONG Len);
  123. UWORD SerGetRawChar(ULONG timeout);
  124.  
  125. /* prototypes for functions in CyberX10Strings. */
  126. STRPTR __asm GetString(register __a0 struct LocaleInfo *li, register __d0 ULONG id);
  127.  
  128. /* extern references to our version and revision numbers */
  129.  
  130. extern ULONG __far Version;
  131. extern ULONG __far Revision;
  132. extern UBYTE __far VersionID[];
  133.